package com.exception.runtime.exception;

import java.io.FileNotFoundException;
import java.io.IOException;

public class WrapCheckException {

	void throwRuntimeException(int type) {
		try {
			switch (type) {
			case 0:
				throw new FileNotFoundException();
			case 1:
				throw new IOException();
			case 2:
				throw new RuntimeException();
			default:
				return;
			}
		} catch (Exception e) {
			// 把“被检查异常Exception”转换为“不被检查的异常RuntimeException”
			throw new RuntimeException(e);
		}
	}

}
